package com.ibeeking.gmc.global.g.rest.controller.v1;

import com.ibeeking.gmc.global.service.common.param.*;
import com.ibeeking.gmc.global.service.common.vo.*;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName: TenantCommerceCertController
 * @Author: zhouwei
 * @Description: 租户-认证信息
 * @Date: 2021/11/26 10:36
 * @Version: 1.0
 */
@RestController
@RequestMapping("/g/tenantIdentification/v1")
public class TenantIdentificationController {

    @Resource
    private com.ibeeking.gmc.global.g.rest.service.ITenantIdentificationService ITenantIdentificationService;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "认证信息-审核状态查询")
    @PostMapping(value = "/auditStatus/view")
    public TenantAuditStatusVO auditStatusView() {
        return ITenantIdentificationService.auditStatusView();
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "认证信息-审核状态修改")
    @PostMapping(value = "/auditStatus/change")
    public Boolean auditStatusChange(@RequestBody TenantAuditStatusParam param) {
        return ITenantIdentificationService.auditStatusChange(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = " 经营主体认证-主体信息查看")
    @PostMapping(value = "/enterprise/enterpriseInfoView")
    public TenantEnterpriseInfoVO enterpriseInfoView() {
        return ITenantIdentificationService.enterpriseInfoView();
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = " 经营主体认证-主体信息保存")
    @PostMapping(value = "/enterprise/enterpriseInfoSave")
    public Boolean enterpriseInfoSave(@RequestBody @Validated TenantEnterpriseInfoParam param) {
        return ITenantIdentificationService.enterpriseInfoSave(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = " 经营主体认证-法人信息查看")
    @PostMapping(value = "/enterprise/legalInfoView")
    public LegalAndAgentInfoVO legalInfoView() {
        return ITenantIdentificationService.legalAndAgentInfoView();
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = " 经营主体认证-法人信息保存")
    @PostMapping(value = "/enterprise/legalInfoSave")
    public Boolean enterpriseInfoSave(@RequestBody @Validated TenantLegalAndAgentInfoParam param) {
        return ITenantIdentificationService.legalAndAgentInfoSave(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "银行账号查看")
    @PostMapping(value = "/bank/view")
    public TenantBankVO bankView() {
        return ITenantIdentificationService.bankView();
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "银行账号保存")
    @PostMapping(value = "/bank/save")
    public Boolean bankSave(@RequestBody @Validated TenantBankParam param) {
        return ITenantIdentificationService.bankSave(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "商标授权查看")
    @PostMapping(value = "/trademarkAuth/view")
    public TenantTrademarkAuthInfoVO trademarkAuthView() {
        return ITenantIdentificationService.trademarkAuthView();
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "商标授权保存")
    @PostMapping(value = "/trademarkAuth/save")
    public Boolean trademarkAuthSave(@RequestBody @Validated TenantTrademarkAuthInfoParam param) {
        return ITenantIdentificationService.trademarkAuthSave(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "品牌授权查看")
    @PostMapping(value = "/brandAuth/view")
    public TenantBrandAuthInfoVO brandAuthView() {
        return ITenantIdentificationService.brandAuthView();
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "品牌授权保存")
    @PostMapping(value = "/brandAuth/save")
    public Boolean brandAuthSave(@RequestBody @Validated TenantBrandAuthInfoParam param) {
        return ITenantIdentificationService.brandAuthSave(param);
    }


}
